﻿using System;
using System.Threading.Tasks;
using Google.Protobuf;
using Plugins.FormicArch.MVVM;

namespace GameFramework
{
    public partial class GameFacadeModel
    {
        /// <summary>
        /// 获取模块
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        public T GetModel<T>() where T : IModel, new()
        {
            return ModelManager.Get<T>();
        }
        /// <summary>
        /// 获取配置
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        public T GetComfig<T>() where T : class, IMessage, new()
        {
            return GameProtoDataCenter.Get<T>();
        }
        /// <summary>
        /// 异步获取配置
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        public Task <T> GetComfigAsync<T>() where T : class, IMessage, new()
        {
            return GameProtoDataCenter.GetAsync<T>();
        }
        /// <summary>
        /// 获取网络数据
        /// </summary>
        /// <param name="Id"></param>
        /// <param name="callback"></param>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        public T GetServerData<T>(int Id,Action<T> callback)   where T : class, IMessage, new()
        {
            return default;
        }
    }
}